package com.czxy.Demo01;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        System.out.println("请输入一个数字");
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        System.out.print("该数字:");
        show(num);
    }
    public static void show(int num){
        if (num % 3 == 0 && num % 5 == 0 && num % 7 == 0){
            System.out.println("能同时被 3，5，7 整除");
        }else if (num % 3 == 0 && num % 5 == 0){
            System.out.println("能同时被 3，5 整除");
        }else if (num % 3 == 0 && num % 7 == 0){
            System.out.println("能同时被 3，7 整除");
        }else if (num % 5 == 0 && num % 7 == 0){
            System.out.println("能同时被 5，7 整除");
        }else if (num % 3 == 0){
            System.out.println("只能被 3 整除");
        }else if (num % 5 == 0){
            System.out.println("只能被 5 整除");
        }else if (num % 7 == 0){
            System.out.println("只能被 7 整除");
        }else{
            System.out.println("不能被3,5,7任一个整除");
        }
    }
}
